//2009/08/16 16:45:34
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class BlackjackWinner
{
public:
    int winnings(int bet, int dealer, int dealerBlackjack, int player, int blackjack)
    {
		if(dealerBlackjack == 1 && blackjack == 1) return 0;
		if(blackjack == 1 && dealerBlackjack == 0) return (int) (1.5*bet);
		if(dealerBlackjack == 1 && blackjack == 0) return -bet;
		else
		{
			if(player > 21 || (player < dealer && dealer <= 21)) return -bet;
			else if(player == dealer && player <= 21) return 0;
			else return bet;
		}
    }
};
